﻿using System;

namespace NumericalSolution {
  class Diffusion1DExact : Diffusion1D {
    public override double[] Next() {
      p_current_u[0] = 0.0;
      for (int i = 1; i < p_numberOfNodes - 1; i++) {
        p_current_u[i] = p_alpha 
                       * Math.Exp(-Math.PI * Math.PI * p_currentTime) 
                       * Math.Sin(Math.PI * i * p_deltaX);
      }
      p_current_u[p_numberOfNodes - 1] = 0.0;

      return p_current_u;
    }
  }
}
